#include <iostream>
using namespace std;
int main() {
  // 0
  // -1 1
  // -3 -1 1 3
  // -7 -5 -3 -1 1 3 5 7
  // 101010101101111
  // 1. judge n is odd
  // 2. the pos of left one
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    if (n & 1) {
      int pos = 0;
      while (n) {
        n >>= 1;
        pos ++;
      }
      cout << pos << endl;
    } else {
      cout << -1 << endl;
    }
  }
}